<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <title>管理后台</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
        <!-- 新 Bootstrap 核心 CSS 文件 -->
        <link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">

        <!-- 可选的Bootstrap主题文件（一般不用引入） -->
        <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

        <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
        <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>

        <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
        <script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
        <link href="Public/admin/css/dashboard.css" rel="stylesheet">


        <!-- Latest compiled and minified CSS -->
        <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.10.1/bootstrap-table.min.css">

        <!-- Latest compiled and minified JavaScript -->
        <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.10.1/bootstrap-table.min.js"></script>

        <!-- Latest compiled and minified Locales -->
        <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.10.1/locale/bootstrap-table-zh-CN.min.js"></script>

        <script src="Public/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
        <script src="Public/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
        <link href="Public/bootstrap-datepicker/css/bootstrap-datepicker.min.css" rel="stylesheet">

        <script src="Public/bootstrap-datepicker/js/bootstrap-table-export.min.js"></script>


        <script src="Public/bootstrap-datepicker/js/bootstrap-table-filter-control.min.js"></script>
    </head>
    <body>
        <nav class="navbar navbar-inverse navbar-fixed-top">
            <div class="container-fluid">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="#">管理后台</a>
                </div>
                <include file="./Public/admin/navbar.html" keywords="1" />

            </div>
        </nav>

        <div class="container-fluid">
            <div class="row">
                <include file="./Public/admin/menu.html" keywords="2" />
                <!--正式内容开始-->
                <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main ">


                    <h2 class="sub-header">会员列表</h2>
                    <div class="input-group input-daterange">
                        <span class="input-group-addon">我要找从</span>
                        <input type="text" class="form-control" value="{$today|date='Y/m/d',###}" name="start">
                        <span class="input-group-addon">到(如果只要一天数据,请留空结束时间.)</span>
                        <input type="text" class="form-control" value="" name="end">
                        <span class="input-group-addon">的数据</span>

                    </div>
                    <br/>

                    <a class="btn btn-default submit" href="javascript:void(0)" role="button">筛选</a>

                    <div class="row" style="margin: 20px 0 0 0;">

                        <div class="col-lg-6">
                            <div class="input-group">
                                <input type="text" class="form-control" name="userid" placeholder="用户ID搜索">
                                <span class="input-group-btn">
                                    <button class="btn btn-default userid" type="button">Go!</button>
                                </span>
                            </div>
                        </div>

                        <div class="col-lg-6">
                            <div class="input-group">
                                <input type="text" class="form-control" name="orderid" placeholder="订单号搜索">
                                <span class="input-group-btn">
                                    <button class="btn btn-default orderid" type="button">Go!</button>
                                </span>
                            </div>
                        </div>
                    </div><!-- /.row -->
                    <!--          <div id="toolbar">
                                <button id="button" class="btn btn-default">getOptions</button>
                            </div>-->
                    <table id="table"></table>


                    <!--page-->
                </div>
                <!--正式内容结束-->
            </div>
        </div>


        <!-- Modal -->
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h4 class="modal-title" id="myModalLabel">提示</h4>
                    </div>
                    <div class="modal-body">
                        ...
                    </div>
                    <div class="modal-footer" style="display: none;">
                        <button type="button" class="btn btn-default" data-dismiss="modal">知道了</button>
                    </div>
                </div>
            </div>
        </div>

    </body>

    <script>
        $('#table').bootstrapTable({
            url:'./index.php?m=Center&c=mz&a=mzRepay',
            sidePagination: 'client',
            silentSort: true,
            pagination: true,
            pageSize: 20,
            search: true,
            showExport: true,
            filterControl: true,
//    clickToSelect:true,
            columns: [{
            field: 'id',
                title: 'id',
                align : 'center',
                valign : 'middle'
            },{        
                field: 'uid',
                title: '用户id',
                align : 'center',
                valign : 'middle'
            },{
                field: 'name',
                title: '用户名',
                align : 'center',
                valign : 'middle'
                
            },{
                field: 'headimgurl_user',
                title: '用户头像',
                align : 'center',
                valign : 'middle',    
                formatter:function(value,row,index){  
                   var a = '<img height="40" src="'+row.headimgurl_user+'">';                   
                        return a;  
                    } 
            },{
                field: 'coin',
                title: '用户金币余额',
                align : 'center',
                valign : 'middle'
            },{
                field: 'mob',
                title: '手机',          
                align : 'center',
                valign : 'middle',
                
            },{
                field: 'zfb_id',
                title: '支付宝',          
                align : 'center',
                valign : 'middle',
                
            },{
                field: 'exchange_desc',
                title: '提现金额',          
                align : 'center',
                valign : 'middle',
                
            },{
                field: 'create_time',
                title: '申请时间',          
                align : 'center',
                valign : 'middle',
                
            },{
                field: 'finish_time',
                title: '处理时间',          
                align : 'center',
                valign : 'middle',
                
            },{
                field: 'status',
                title: '状态',
                align : 'center',
                valign : 'middle',
                formatter:function(value,row,index){  
                    var s ;
                    if(row.status==1){
                        s = "已处理";
                    }else if(row.status==2){
                        s = "拒绝";
                    }else if(row.status==0){
                        s = "未处理";
                    }
                        return s;     
                }
            },{
                field: 'option',
                title: '编辑',
                align : 'center',
                valign : 'middle',
                formatter:function(value,row,index){  
                  
                   var e = '<a href="./index.php?m=Center&c=mz&a=rePayStatus&id='+row.id+'&price='+row.need_jf+'&uid='+row.uid+'&status=1" >'+'处理 |</a> ';  
                   var c = '<a href="./index.php?m=Center&c=mz&a=rePayStatus&id='+row.id+'&price='+row.need_jf+'&uid='+row.uid+'&status=2" >'+'拒绝 |</a> '; 
                   var d = '<a href="./index.php?m=Center&c=Admin&a=delete&table=user_exchange_data&did='+row.id+'">删除</a> '; 
                        return e+c+d;  
                    } 
            }  ]
        });

        $('.input-daterange input').each(function () {
            $(this).datepicker({
                'todayHighlight': true,
                'startDate': '2015/5/5',
                'format': 'yyyy/mm/dd',
                'language': 'zh-CN',
                'todayBtn': true,
                'autoclose': true
            });
        });
        $(".submit").click(function () {
            $('#table').bootstrapTable('refresh', {url: '?m=Center&c=mz&a=mzRepay&start=' + $("input[name='start']").val() + '&end=' + $("input[name='end']").val()});
        });
 
        $(".userid").click(function () {
            $('#table').bootstrapTable('refresh', {url: '?m=Center&c=mz&a=mzRepay&userid=' + $("input[name='userid']").val()});
            $("input[name='table']").val('');
        });
        $(".orderid").click(function () {
            $('#table').bootstrapTable('refresh', {url: '?m=Center&c=mz&a=mzRepay&orderid='+ $("input[name='orderid']").val()});
            $("input[name='userid']").val('');
        });
        $('#button').click(function () {
//    var json = JSON.stringify($('#table').bootstrapTable('getSelections'));
            var arr = $('#table').bootstrapTable('getSelections');
            arr.forEach(function (e) {
                console.log(e.nickname);
            })
//            alert($('#table').bootstrapTable('getSelections'));
        });
        
        
    </script>
</html>
